package collections1;

import java.util.*;

public class CollectionsDemo {

	public static void main(String[] args) {
		List<String> list = new ArrayList<String>();
		list.add("andy");
		list.add("candy");
		list.add("tim");
		list.add("james"); 
		list.add("zoo");
		list.add("kobe");
		System.out.println(list);

		System.out.println("集合中的最大值是：" + Collections.max(list));
		System.out.println("集合中的最小值是：" + Collections.min(list));

		System.out.println("**********************");
		Collections.sort(list);
		for (int i = 0; i < list.size(); i++) {
			System.out.println(list.get(i));
		}
		System.out.println(Collections.binarySearch(list, "james"));

		System.out.println("**********************");
		Collections.reverse(list);
		for (String lists : list) {
			System.out.println(lists);
		}
	}

}
